ASD cannot add ATC messages to sceneries. However, messages added to .SC1
files with other programs (or manually!) are correctly played by FS4 and do
not interfere with ASD ability to manipulate the modified .SC1.
The following structure has been determined from SEE4-modified sceneries.
ATC messages are made by:
∙ an area record
∙ a 5-byte jump record with fixed contents: 0Bh 0005h 41h 43h (where 4341h isprobably an ID meaning "ATC")
∙ an ATC message record (1Eh)
====================
POLYGONS
Polygon descriptions are made of an area record, a ref. point record, asurface colour record and a point list. As for any object of variable size,
area radius is not fixed, like in nav aids, but depends on the polygon size.
Triangles are special, because, after the polygon proper, they add a 3-point
line corresponding to two of the three sides of the triangle; this line has
the same colour of the triangle and cannot be seen.
Example:
3E 3E 00 92 03 8D 04 03 00 24 04 00 4D 8D 04 00
0A 00 00 00 B9 92 03 25 E2 02 99 99 2F 40 F2 FF
08 00 41 0D 00 0B 00 41 0F 00 F6 FF 29 12 09 40
F2 FF 08 00 41 0D 00 0B 00 41 0F 00 F6 FF
is interpreted as:
3Eh Area record
003Eh object is 62 bytes long
0392h N coord of visib. area is 17298
048Dh E coord of visib. area is 17549
0003 area radius is 3 FSu
24h 04h Ref. point record
048D4D00h E coord is [048D.4Dh =] 1165+77/256 + 16384 = 17549.0273
00000A00h altitude above ground level is [00000Ah =] 10 m 0392B900h N coord is [0392.B9h =] 914+185/256 + 16384 = 17298.7227
25h Set variable record
02E2h variable at 02E2 (surface colour)
9999h set to colour 9 (yellow)
2Fh Point list begin
40h Move record
FFF2h E coord of P1: [FF.F2h =] -14/256 + 17549.0273 = 17548.9726
0008h N coord of P1: [00.08h =] 8/256 + 17298.7227 = 17298.754041h Draw record
000Dh E coord of P2: [00.0Dh =] 13/256 + 17549.0273 = 17549.0781
000Bh N coord of P2: [00.0Bh =] 11/256 + 17298.7227 = 17298.7657
41h Draw record
000Fh E coord of P3: [00.0Fh =] 15/256 + 17549.0273 = 17549.0859
FFF6h N coord of P3: [FF.F6h =] -10/256 + 17298.7227 = 17298.6836
29h Close and fill (polygons with 4 or more points, would stop there)
12h 09h Line colour is 9 (yellow)40h FFF2h 0008h same move record as above
41h 000Dh 000Bh same draw record as above
41h 000Fh FFF6h same draw record as above
====================
RIVERS
Even if they are created in ASD stretching and bending rectangular strips of
colour, rivers are actually memorized in scenery files as polygons, and
follow the same format described in the previous section. The reason for
keeping them in a specific section resides probably in the order in which
scenery object are drawn.
Rivers can also contain skips: in this case, the river description contains a
single area record and a single ref. point record followed by a surfacecolour record and a point list for each polygon created by skipping.
====================
ROADS
Roads also are memorized as polygons, and follow the polygon format. For
skippings, the same observation made about rivers, holds also for roads.
Country roads and city streets require no observations.
4-lane roads contain, after the point list describing the road perimeter, a
line colour record and a line point list describing the road middle line.
Divided highways, after the area and ref. point records, contain a single
surface colour record (25h) with two polygon point lists to describe the tworoad ways, then a line colour record, a conditional jump record (23h) on var
028Ch value and another line colour record to change colour line according to
time, and a line point list with 4 jumps to describe the 4 borders of the
ways.
====================
LINES
Line descriptions are made of an area record, a ref. point record, a line
colour record and a line point list. If the line contains skips, a new line
colour record and a new line point list are generated for each line section.
====================
RUNWAYS
Runway descriptions are made of 2 area records referring to the same point
(one for the distance at which the runway is sketchily visible, the other for
the distance at which it is fully visible), a 25h record to set area altitude
and the specialized runway record:
Runway record - code: 50h/D0h length: 35 bytes
0 1 50h or D0h: record code
1 4 E coord of center (fract. FSu)
5 4 Altitude (fract. FSu)
9 4 N coord of center (fract. FSu)
13 1 Design elements (bit is 1 if the element is present):
3B F1/F5 3C F2/F4 45 NumLk 46 Gr /|*|ScrollLk3D F3/F6 3E F4/F3 47 Home 48 Up 49 PgUp 4A Gr -
3F F5/∙∙ 40 F6/∙∙ 4B Left 4C Pad 5 4D Right 4E Gr +|<─┘
41 F7/F7 42 F8/F2 4F End 50 Down 51 PgDn
43 F9/F8 44 F10/F1 52 Ins 53 Del 56 '<'∙∙∙
Notes:
∙ Scan codes 1D, 2A, 2B, 36, 38 would correspond to Ctrl, Left Shift, '\',
Right Shift, Alt respectively; but within demos, Shift and '\' keys do notgenerate any code, while Ctrl and Alt keys generate a 00 code.
∙∙ No F key of 101-key keyboard correspond to F5 and F6 of 83-key keyboard:
therefore those codes are never recorded with a 101-key keyboard
∙∙∙ Code 56 is generated (and recorded) only with 102-key European keyboards.
RECORDS
All records have a code >= 80h and are therefore easily differentiated from
key codes.
Only 8 kinds of records have been recognized and are listed below. The first
four of them are actually found in demo files generated by the demo recorder;
the other four have been found in the demo supplied with the program (the
default demo as well as the instructor flights of the flight school and thelead plane flights of the formation entertainement which are all regular demo
files), but are correctly played back if manually inserted in a recorded
demo.
A recorded demo has a very simple structure: it is made of sample rate
records (either 80h or 81h) followed by long position records; between a
position record and the next sample rate record, the codes for key pressed by
the user are inserted. The file is not divided in sections (like, forinstance, scenery files) nor its end is marked in any way.
-- 80h ------------- 1 sec (1 byte)
This single byte record marks a sample rate of 1 sec and is usually followed
by a long position record.
-- 81h ------------- 5 sec (1 byte)
This single byte record marks a sample rate of 5 sec and is usually followed
by a long position record.
-- 82h ------------- Long position record (19 bytes)
13 2 pitch (noze down is positive, noze up is negative)
15 2 bank (left is positive, right is negative)
17 2 heading
This record has the same structure of the 82h record, but contains also a 5
sec sample rate information.
-- 94h ------------- Short position record (7 bytes)
This record describes the variations of the 6 position parameters relatives
to a previous position record (either a 90h record or another 94h record). It
can be used also after an 82h record, even if MS demos never do so.
The record includes also 1 sec of sample rate.
1 1 E coord. delta
2 1 Alt. delta
3 1 N coord. delta
4 1 Pitch delta
5 1 Bank delta
6 1 Heading delta
Linear parameters are in m, angular parameters in 1.4° (= 360° / 256); all 6parameters are signed: the max linear delta is therefore 127 m, and the max
angular delta is 180°.
Short position records save 12 bytes each over long position records.
Apparently, there is no short position record for 5 sec interval.
========================================
MODE FILES (.MOD)
Mode files still have many obcure points, but almost all the parameters the
can be set from FS menu are decoded. Exceptions are mouse sensitivity
parameters, because I do not use a mouse with FS (it seems to me like driving
a car with the foots), and joystick parameters because I do not have one (Iam a serious person, I don't play games!).
There is a lot of undecoded 1-byte fields; they are probably unused and maybe
are only the MSBytes of word fields which never exceed an 8-bit value.
Screen coordinates (for window positions) are apparently device-independent
(I tried on a VGA and a Hercules): ascissae span from 0032h to 1FD6h and
ordinates from 0032h to 17D4h; origin is in the upper left corner.
The following listing follows the same format used above, but, given the
length of the mode "record", a column with hex offset has been added.
Key labels (as <F1>) refer to the 101-key keyboard.
0 0000 2 020Eh: file length 2 0002 2 0017h: pointer to mode name
4 0004 1 01h: mode file signature
5 0005 4 Initial E coord. (fract. FSu)
9 0009 4 Initial AGL alt. (fract. FSu)
13 000D 4 Initial N coord. (fract. FSu)
17 0011 2 Initial pitch
19 0013 2 Initial bank
21 0015 2 Initial heading 23 0017 31 Mode name (padded with spaces and 0-terminated)
517 0205 1 Strobe: 00h off - 01h on 518 0206 8 .SIM file name. .SIM files define the visual appearance of the
aircraft; the name is padded with space if shorter than 8
chars. No path nor extension are allowed (a standard .SIM
extension is apparently supplied by the program)
FS4 .SIMs:
SIM1.SIM Cessna R182
SIM2.SIM Gates Learjet 25G
SIM3.SIM Schweizer 2-32 Sailplane SIM4.SIM Sopwith Camel
SIM5.SIM Experimental aircraft
ASD .SIMs:
SIM7.SIM Experimental jet aircraft
SIM8.SIM Experimental sailplane
SIM9.SIM Boeing 747-400
SIMA.SIM Beechcraft Starship
SIMB.SIM Piper Cherokee Archer II SIMC.SIM Cessna 182 seaplane
========================================
APPENDIX: A NOTE ON F1 (DEFAULT SCENERY) HEADER
The following note is a first step in attempting to decode the default
scenery F1 supplied with FS. Only the initial file header is covered. It
has been checked with sceneries supplied with FS veriosn 4.0 and 4.0b. They
are different, but perhaps only marginally and, in any case, not in the
portion covered here.
0000h 2 02DDh: ??
0002h 2 0106h: pointer to dialogue descriptor (see below)0004h 28 ??
0020h 2 0026h: number of scenery regions in the file
Then, a table is given with, for each scenery region:
4 long pointer to region offset in the file
2 region length in bytes
Table ends at 0106h. A descriptor of the dialogue window displayed when the
scenery is selected follows:
0106h 1 01h: ??
0107h 2 01F4h: X screen coordinate of text line
0109h 2 0258h: Y screen coordinate of text line
010Bh 25 text line: "Available Flight Areas:" 0-terminated and with
a 0 byte added at both ends
This is repeated for the 7 text lines up to
0186h 5 00h 3Ch 00h FFh 28h ??
018Bh 35 two 21h records and one 79h record
After that, the first scenery begins. I sampled them at random and they seems
to be made of the same record machinery (maybe with some new record types) ofother kinds of scenery, but have no header or section tables as .SC1 files
do. F1, as well as *.SCN, do not use a linked list of 3Eh records, but a
linked list of many kinds of record (21h occurring very often).
==================== FSSTRUCT END ====================